package libtool65.cmd;

import java.io.FileInputStream;
import java.io.IOException;

import libtool65.o65.Module;
import libtool65.o65.Reader;

public abstract class LinkerBase extends Command {

	public LinkerBase() {
		super();
	}

	public Module readModule(Reader reader, String file) {
		Module module = null;
		FileInputStream infile = null;
		try {
			infile = new FileInputStream(file);
			module = reader.read(infile);
		} catch (Exception e) {
			System.err.println("Error reading file "+file);
		}
		finally
		{
			if (infile != null)
				try { infile.close(); } catch (IOException e) {}
		}
		return module;
	}

}